<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript"
	src="http://www.phpddt.com/usr/themes/dddefault/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/ajaxfileupload.js"></script>

</head>

<body>
	<form id= "uploadForm" action= "" method= "post" >  
     <h1 >测试通过Rest接口上传文件 </h1>  
     <p >指定文件名： <input type ="text" name="filename" /></p>  
     <p >上传文件： <input type ="file" name="file" /></p>  
     <!--  <input type ="submit" value="上传"/>   -->
     <button id="btn" onclick="doUpload()">上传</button>
</form>  
</body>

 <script type="text/javascript">
 
 function doUpload() {  
	 alert("aaaaaaaaa");
     var formData = new FormData($( "#uploadForm" )[0]);  
     $.ajax({  
          url: '/movie.front/upload/saveUpload' ,  
          type: 'POST',  
          data: formData,  
          async: false,  
          cache: false,  
          contentType: false,  
          processData: false,  
          success: function (returndata) {  
              alert(returndata);  
          },  
          error: function (returndata) {  
              alert(returndata);  
          }  
     });  
}  
    </script>
</html>
